<template>
    <div class="inputbar">
        <input type="text" placeholder="回车确定添加" class="inputbar" v-model="msg" v-on:keyup.enter="add">
        <button v-on="add">add</button>
    </div>
</template>

<script>
export default({
    name:'InputBar',
    data:function(){
        return {
            'msg':''
        }
    },
    methods:{
        add:function(){
            this.$emit(addmsg,msg)
        }
    }
})
</script>

<style scoped>
    .inputbar{
        width: 300px;
        height: 50px;
        margin: auto;
        display:inline;
        margin-top: 20px;
    }
</style>